home *** CD-ROM | disk | FTP | other *** search
/ Loadstar - Compleat Bible / oldtest1.d81 / o.whole search (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  4KB  |  93 lines

  1. 15 poke56,40:clr:print"";:dv=peek(186):ifdv<8ordv>16thendv=8
  2. 37 sys57812"bible 3000",dv,0:poke780,0:poke781,0:poke782,48:sys65493
  3. 38 sys57812"dtext 2800",dv,0:poke780,0:poke781,0:poke782,40:sys65493
  4. 40 mt=12288:dt=10240:dimfi$(10),d%(7),b$(66)
  5. 50 poke53374,0:poke53366,0:poke53375,0:fori=1to2000:next
  6. 55 sysmt+201,95,105,4,10,14,1,14,7,6,1,0,0
  7. 60 sys10240,"books",dv,80*256:sysmt+36,80*256:wb=peek(20):sysmt+54:bl=f%
  8. 66 fori=0to65:readb$(i):next:bb=0:bc=1:bv=1:poke53272,23
  9. 80 poke650,128:sh=mt+96:fr=mt+6:ce=mt+78:bo=mt+3:at=ce-3
  10. 85 x=0:fori=8to29:ifi<>14thenclose2:open2,i,2:close2:ifst=0thend%(x)=i:x=x+1
  11. 90 next:fori=0tox:ifd%(i)=dvthena=i
  12. 95 next:nd=x:i=d%(0):d%(a)=i:d%(0)=dv:dx=0
  13. 100 t$="[194]ible [211]earch":a$(1)="[211]tart [193] [211]earch      ([211])
  14. 125 a$(2)[178]"peekack to (NULL)ain (NULL)odule ((NULL))":a$(3)[178]"(NULL)eturn to (NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL)  ((NULL))":h$[178]" smq
  15. 145 sysmt+198,t$,3,a$(1),a$(2),a$(3),h$:onf%gosub300,190,190,210:goto100
  16. 190 f$="compleat ot":goto2300
  17. 210 f$="hello connect":goto2300
  18. 300 sysmt+36,80*256:sysmt,1,38,1,23,95,105,15,12
  19. 310 syssh,2,2+wb,3,20:sysbo,3,3+wb,14,19,160,15:sysat,4,15,"[155][208]lease select each
  20. 330 [158]at,4,16,"book to be searched":[158]at,4,17,"w/(NULL)val(NULL)(NULL)(NULL)(NULL). (NULL)left$-(NULL) to
  21. 350 sysat,4,18,"find book. [198]1 [206]ext":sysmt+42,3,3+wb,2,12,1,12,7,1,bb,65,1:gosub2400:return
  22. 370 ww$=w$:sysmt+84,w$:f$=w$:t=0
  23. 380 gosub1000:iff%=-1orval(a$)thenift<ndthengosub2100:goto380
  24. 390 iff%=-1thene$="error bnf":gosub2200:return
  25. 400 sysmt+48,0:sysmt+27,bl:sysmt+30,ww$,bo%,1:sysdt,w$,d%(dx),84*256:hs=0:lh$=w$
  26. 1000 sysmt+39,"$:"+f$,d%(dx),208*256:sysmt+48,0:close15:open15,d%(dx),15:input#15,a$,e$:close15:return
  27. 2100 dx=dx+1:ifd%(dx)=0thendx=0
  28. 2110 t=t+1:return
  29. 2200 syssh,0,39,0,24:sysmt+48,0:sysmt+15,e$,dv,28000:sysmt+36,28000:en=f%-1
  30. 2205 ife$="error bnf"thensysmt+30,"   [201] couldn't find "+chr$(34)+f$+chr$(34),1,1
  31. 2210 sysbo,0,39,1,19,160,7:sysfr,0,39,0,20,2:sysmt+42,1,38,1,19,1,7,1,1,0,en-1,0:return
  32. 2300 t=0
  33. 2310 gosub1000:ifval(a$)orf%<0thenift<ndthengosub2100:goto2310
  34. 2320 ifval(a$)=0andf%>-1then40000
  35. 2330 e$="error bnf":goto2200
  36. 2400 print"[159]";:sysmt+27,bl:poke828,0:sysmt+213,0,65:iff%>-1then2460
  37. 2410 a$="[206]o books selected":gosub5020:poke1998,0:return
  38. 2460 sysbo,2,37,22,22,32,0:sysat,2,22,"[146][158][211]earch:":sysmt+51,1,3,20,"":s$=w$:ifs$=""thenreturn
  39. 2480 of$="":a$="[199]enerate [207]utput [198]ile ([217]/[206])?":gosub5020:geta$:ifa$<>"y"then2560
  40. 2490 sysbo,2,37,22,22,32,0:sysat,2,22,"[146][159][207]utfile name: 
  41. 2500 [158]mt[170]51,1,7,16,"@0:search.txt":of$[178]w$
  42. 2515 [158]bo,2,37,22,22,32,0:[158]at,2,22,"waitopenstr$evice number: 
  43. 2520 sysmt+51,1,7,2,mid$(str$(dv),2):of=val(w$):ifof=0thenof$="
  44. 2530 [139]of$[179][177]""[167][159]5,of,7,of$[170]",s,w":[152]5,[199](13)[199](13)
  45. 2560 [129]bb[178]0[164]65:[158]mt[170]48,0:[158]mt[170]27,bl:[158]mt[170]33,bb:bo$[178]w$
  46. 2570 [139]f%[167]f$[178]b$(bb)[170]"???-???":a$[178]"(NULL)earching "[170]w$:[141]5000:[141]4000
  47. 2575 [130]:[160]5:[151]186,dv:[138]:[144]:[158]mt[170]27,bn:[158]mt[170]33,bo%:[142]
  48. 4000 dx[178]0
  49. 4010 [141]1000:[139]f%[179]0[167][139]dx[179](nd[171]1)[167]dx[178]dx[170]1:[137]4010
  50. 4020 [139]f%[179]0[167][142]
  51. 4025 fi[178]f%:[158]mt[170]48,1:[129]j[178]0[164]fi:[158]mt[170]33,j:fi$(j)[178]w$:[130]:jj[178]0
  52. 4030 [139]of[178]d%(dx)[167][160]5
  53. 4033 [158]mt[170]48,0:[158]dt,fi$(jj),d%(dx),84[172]256:[158]mt[170]36,84[172]256:en[178]f%[171]2:sp[178]0
  54. 4040 [158]mt[170]210,s$,sp,en:[139]f%[177][171]1[167][141]5100
  55. 4090 [139]jj[179]fi[167]jj[178]jj[170]1:[137]4030
  56. 5000 [158]mt,0,39,0,24,107,115,4,10
  57. 5005 [158]sh,0,37,16,21:[158]fr,1,38,16,20,15:[158]bo,2,37,17,19,160,1:[153]"";:[158]ce,18,a$:[142]
  58. 5020 [141]5000:[151]198,0:[146]198,15:[142]
  59. 5100 sp[178]f%:k[178]0
  60. 5110 [139](sp[171]k)[177]0[167]k[178]k[170]1:[158]mt[170]33,sp[171]k:[139]w$[179][177]""[167]5110
  61. 5120 bv[178]sp[171]k:k[178]0:[139]sp[177]en[167]ev[178]sp:[142]
  62. 5140 [139](sp[170]k)[179]en[167]k[178]k[170]1:[158]mt[170]33,sp[170]k:[139]w$[179][177]""[167]5140
  63. 5150 ev[178]sp[170]k:[139]ev[177]en[167]ev[178]en
  64. 5160 a$[178]" ":[141]5000:[158]bo,0,39,0,0,160,15:[158]bo,0,39,1,1,160,1:[158]bo,0,39,2,2,160,12
  65. 5166 [158]bo,0,39,4,4,160,1:[158]bo,0,39,5,14,160,15:[158]bo,0,39,15,15,160,12
  66. 5167 [153]"";:[158]ce,1,bo$:a[178]0:[153]"list";:[129]l[178]bv[164]bv[170]9:[139]l[179]en[167][158]mt[170]33,l:[158]at,1,5[170]a,w$:a[178]a[170]1
  67. 5180 [130]:[139]of$[179][177]""[167]a$[178]"(NULL)riting to "[170]of$:[141]5005:[141]5600:[137]5300
  68. 5200 [153]"";:[158]at,3,17,"ascind (NULL)ext (NULL)ccurrence       ((NULL))
  69. 5220 sysat,3,18,"[208]rint [212]his [207]ccurrence      ([208])
  70. 5230 [158]at,3,19,"(NULL)uit and (NULL)e-start (NULL)rogram  ((NULL))
  71. 5240 sysmt+63,17,2,37,3,1,7,"npq":onf%goto5300,5400,5500
  72. 5300 ifsp=enthenreturn
  73. 5305 sp=ev:sysmt+210,s$,sp,en:iff%>-1then5100
  74. 5310 return
  75. 5400 close4:open4,4,7:close4:ifstthen5240
  76. 5405 open4,4,7:iflb$<>bo$thenprint#4,"[**"s$" found in "bo$"**]":lb$=bo$
  77. 5410 forl=bvtoev:sysmt+33,l:print#4,w$:next:close4:poke631,asc("n"):poke198,1:goto5240
  78. 5500 close5:poke186,dv:run
  79. 5600 ifof=d%(dx)thenclose5:open5,of,5,of$+",s,a
  80. 5605 [139]lb$[179][177]bo$[167][152]5,"[**"s$" found in "bo$"**]":lb$[178]bo$
  81. 5610 [129]l[178]bv[164]ev:[158]mt[170]33,l:[152]5,w$:[130]:[142]
  82. 10000 _"@0:o.whole search"
  83. 10001 [144]
  84. 40000 [151]53374,0:[151]53367,0:[151]53375,0:q$[178][199](34):[151]646,[194](53281):[153]"load":[151]53272,23
  85. 40100 [153]"loadl(NULL)"q$f$q$","d%(dx):[153]"p(NULL)53272,23:run:":[151]631,13:[151]632,13:[151]198,2:[128]
  86. 41000 [131]"gene","exod","levi","numb","deut","josh","judg","ruth","1sam","2sam
  87. 41100 data"1kin","2kin","1chr","2chr","ezra","nehi","esth","job","psal","prov
  88. 41200 [131]"eccl","song","isai","jere","lame","ezek","dani","hose","joel","amos
  89. 41300 data"obad","jona","mica","nahu","haba","zeph","hagg","zech","mala","matt
  90. 41400 [131]"mark","luke","john","acts","roma","1cor","2cor","gala","ephe","phil
  91. 41500 data"coll","1the","2the","1tim","2tim","titu","phmn","hebr","jame","1pet
  92. 41600 [131]"2pet","1joh","2joh","3joh","jude","reve
  93.